﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BTN04.DAO;
using BTN04.DTO;
using System.Collections.Generic;

namespace BTN04.BUS
{
    public class LoaiSanPhamBUS
    {
        public List<LoaiSanPhamDTO> DanhSachLoaiSanPham()
        {
            LoaiSanPhamDAO lspDAO = new LoaiSanPhamDAO();
            return lspDAO.DanhSachLoaiSanPham();
        }
        public LoaiSanPhamDTO LayLoaiSanPhamTheoMa(int mlsp)
        {
            LoaiSanPhamDAO lspDAO = new LoaiSanPhamDAO();
            return lspDAO.LayLoaiSanPhamTheoMa(mlsp);
        }

        //Hien thi chi tiet thong tin loai San Pham
        public List<LoaiSanPhamDTO> DanhSachChiTietLoaiSanPham()
        {
            LoaiSanPhamDAO lspDAO = new LoaiSanPhamDAO();
            return lspDAO.DanhSachChiTietLoaiSanPham();
        }
        //Hien thi thong tin chi tiet cua loai san pham theo ma
        public LoaiSanPhamDTO HienThiChiTietLoaiSanPhamTheoMa(int ma)
        {
            LoaiSanPhamDAO lspBus = new LoaiSanPhamDAO();
            return lspBus.HienThiChiTietLoaiSanPhamTheoMa(ma);

        }

        //Them Mot loai san pham
        public int ThemMotLoaiSanPham(LoaiSanPhamDTO lsp)
        {
            LoaiSanPhamDAO lspDAO = new LoaiSanPhamDAO();
            return lspDAO.ThemMotLoaiSanPham(lsp);


        }
        //Xoa  nha san xuat
        public int XoaMotLoaiSanPham(int ma)
        {
            LoaiSanPhamDAO lspDAO = new LoaiSanPhamDAO();
            return lspDAO.XoaMotLoaiSanPham(ma);

        }
        //Cap nhat nha san xuat
        public int CapNhatThongTinMotLoaiSanPham(LoaiSanPhamDTO lsp)
        {
            LoaiSanPhamDAO lspDAO = new LoaiSanPhamDAO();
            return lspDAO.CapNhatThongTinLoaiSanPham(lsp);


        }

    }
}
